//
//  UINavigationController+ControllerClassName.m
//  frame
//
//  Created by 黎世炜 on 17/4/17.
//  Copyright © 2017年 黎世炜. All rights reserved.
//

#import "UIViewController+ControllerClassName.h"

#import <objc/runtime.h>

@implementation UIViewController (ControllerClassName)

+(void)load{
    //替换viewWillAppear 方法为自定义logViewWillAppear:
    Method viewWillAppear = class_getInstanceMethod(self, @selector(viewWillAppear:));
    
    Method logViewWillAppear = class_getInstanceMethod(self, @selector(logViewWillAppear:));
    
    method_exchangeImplementations(viewWillAppear, logViewWillAppear);
}



-(void)logViewWillAppear:(BOOL )animated{
    NSString * className = NSStringFromClass([self class]);
    NSLog(@"lacssName ==== %@",className);
    [self logViewWillAppear:animated];
}

@end
